﻿namespace Vestras.StarCraft2.Luna.Parser.Ast {
    public sealed class Variable : Entity {
        Expression value;

        public string Name { get; internal set; }
        public Modifiers Modifiers { get; internal set; }
        public TypeReference Type { get; internal set; }
        public Expression Value {
            get { return value; }
            internal set {
                this.value = value;
                if (value != null) {
                    HasBeenAssigned = true;
                }
            }
        }

        public bool IsParameter { get; internal set; }
        public bool HasBeenAssigned {
            get;
            set;
        }

        public int OrderIndex {
            get;
            set;
        }

        public override string ToString() {
            return GetType().Name + " Name = [ " + Name + " ], Type = [ " + Type + " ]";
        }
    }
}
